<template>
  <view class="bd">
    <view class="inp-group" style="">
      <view class="inp-item uni-item-line flex flex-al-c">
        <view class="inp-title" style="width: 200upx">就诊医院</view>
        <input class="inp" type="text" v-model="hospital" disabled="true" />
      </view>
      <view class="inp-item uni-item-line flex flex-al-c">
        <view class="inp-title" style="width: 200upx">就诊科室</view>
        <input
          class="inp"
          type="text"
          placeholder="暂无科室"
          v-model="department"
          disabled="true"
        />
      </view>
      <view class="inp-item uni-item-line flex flex-al-c">
        <view class="inp-title" style="width: 200upx">就诊医生</view>
        <input
          class="inp"
          type="text"
          placeholder="暂无意思"
          v-model="doctor"
          disabled="true"
        />
      </view>
      <view style="height: 50upx"></view>
      <view class="inp-item uni-item-line flex flex-al-c">
        <view class="inp-title" style="width: 200upx">病情描述</view>
        <textarea
          class="t1"
          placeholder="暂无病情描述"
          v-model="represent"
          disabled="true"
        />
      </view>
      <view class="inp-item uni-item-line flex flex-al-c">
        <view class="inp-title" style="width: 200upx">医生建议</view>
        <textarea
          class="t1"
          placeholder="暂无医生建议"
          v-model="doctorRecord"
          disabled="true"
        />
      </view>
      <view class="inp-item uni-item-line flex flex-al-c">
        <view class="inp-title" style="width: 200upx">就诊时间</view>
        <input
          class="inp"
          type="text"
          placeholder="暂无就诊时间"
          v-model="visitTime"
          disabled="true"
        />
      </view>
      <view class="inp-item uni-item-line">
        <view class="inp-title" style="width: 200upx">检查报告</view>
        <view class="flex flex-al-c" style="overflow-x: scroll">
          <view v-for="item in imgUrl" class="imgbox">
            <uploadimg :item="item"></uploadimg>
            <!-- <image :src="item" mode="aspectFit" v-if="imgUrl"
							style="width:800upx;height:200upx;margin-right:30upx;" @click="TanPreviewImage(item)"></image> -->
          </view>
        </view>
      </view>
      <!-- <view class="inp-item uni-item-line">
				<view class="inp-title" style="width: 200upx;">医生报告</view>
				<view class="flex flex-al-c" style="overflow-x: scroll;">
					<view v-for="item in imgUrls" class="imgbox">
						<uploadimg :item='item'></uploadimg> -->

      <!-- <image :src="item" mode="aspectFit" v-if="imgUrl"
							style="width:800upx;height:200upx;margin-right:30upx;" @click="TanPreviewImage(item)"></image> -->
      <!-- 		</view>
				</view>
			</view> -->
      <view style="margin-top: 100upx">
        <button type="default" class="sbtn" @tap="sub">返回</button>
      </view>
    </view>
  </view>
</template>

<script>
import uploadimg from "@/components/uploadimg/uploadimg";
export default {
  components: { uploadimg },
  data() {
    return {
      doctor: "",
      hospital: "",
      department: "",
      imgUrl: [],
      imgUrls: [],
      represent: "",
      visitTime: "",
      doctorRecord: "",
    };
  },
  onLoad(options) {
    console.log(options);
    let pars = JSON.parse(options.obj);
    this.doctor = pars.doctor;
    this.hospital = pars.hospital;
    this.department = pars.department;
    this.imgUrl = (pars.imgUrl || "").split(",");
    this.imgUrls = (pars.doctorImgUrl || "").split(",");
    this.represent = pars.represent;
    this.visitTime = pars.visitTime;
    this.doctorRecord = pars.doctorRecord;
  },
  onReady() {
    // this.getUiStyle();
  },
  methods: {
    getUiStyle() {
      var style = plus.navigator.getUiStyle();
      if ("dark" == style) {
        console.log("当前为暗黑模式");
        uni.setTabBarStyle({
          backgroundColor: "#1B1C1E",
        });
        uni.setNavigationBarColor({
          frontColor: "#ffffff",
          backgroundColor: "#1B1C1E",
          animation: {
            duration: 400,
            timingFunc: "easeIn",
          },
        });
      } else {
        console.log("当前为普通模式");
      }
    },
    sub() {
      uni.navigateBack({});
    },
    // TanPreviewImage(imageUrl){
    //         //console.log(imageUrl) // http://192.168.100.251:8970/6_1597822634094.png
    //         var images = [];
    //         images.push(imageUrl);
    //         //console.log(images)  // ["http://192.168.100.251:8970/6_1597822634094.png"]
    //         uni.previewImage({ // 预览图片  图片路径必须是一个数组 => ["http://192.168.100.251:8970/6_1597822634094.png"]
    //             current:0,
    //             urls:images,
    //             longPressActions: {  //长按保存图片到相册
    //                 itemList: ['保存图片'],
    //                 success: (data)=> {
    //                     //console.log(data);
    //                     uni.saveImageToPhotosAlbum({ //保存图片到相册
    //                         filePath: payUrl,
    //                         success: function () {
    //                             uni.showToast({icon:'success',title:'保存成功'})
    //                         },
    //                         fail: (err) => {
    //                             uni.showToast({icon:'none',title:'保存失败，请重新尝试'})
    //                         }
    //                     });
    //                 },
    //                 fail: (err)=> {
    //                     //console.log(err.errMsg);
    //                 }
    //         }
    //         });
    //     }
  },
};
</script>

<style lang="less" scoped>
.inp-group {
  width: 85%;
  margin: 0 auto;
  margin-bottom: 30rpx;
  padding-bottom: 30rpx;

  .inp-item {
    margin-top: 10upx;
    padding: 15upx 0;
    .inp-title {
      padding: 15upx 0;
      font-size: 30upx;
      font-weight: 900;
      color: #777;
    }
    .inp {
      padding: 15upx 0;
      color: #333;
    }
  }
  .sbtn {
    background: #18c7e1;
    color: #fff;
  }
}
</style>
<style scoped>
@media (prefers-color-scheme: closedark) {
  //  黑暗模式
  .bd {
    background-color: #1b1c1e !important;
    margin-top: -5px;
    height: 100%;
  }
  .t1 {
    color: #ccc !important;
  }
  .inp {
    color: #e5e8e8 !important;
  }
}
</style>